<?php

/**
 * This is the model class for table "{{beceri_basamaklari}}".
 *
 * The followings are the available columns in table '{{beceri_basamaklari}}':
 * @property integer $id
 * @property integer $beceri_id
 * @property integer $sira
 * @property string $basamak_metni
 * @property integer $kategori_mi
 */
class BeceriBasamaklari extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return BeceriBasamaklari the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return '{{beceri_basamaklari}}';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules()
	{
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array('beceri_id, sira, kategori_mi', 'numerical', 'integerOnly'=>true),
			array('basamak_metni, basamak_metni_en', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, beceri_id, sira, basamak_metni, basamak_metni_en, kategori_mi, video_url, resim_url, ses_url, anim_url, resimleme_url', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'beceri_id' => 'id',
			'sira' => Araclar::yaz('Sira','Order'),
			'basamak_metni' => Araclar::yaz('Beceri Basamağı','Skill Step'),
			'basamak_metni_en' => Araclar::yaz('Beceri Basamağı','Skill Step'),
			'kategori_mi' => Araclar::yaz('Kategori Mi','Is it a Category'),
			'video_url' => Araclar::yaz('Video Adres (URL)','Video Adress (URL)'),
			'resim_url' => Araclar::yaz('Resim Adres (URL)','Picture Adress (URL)'),
			'ses_url' => Araclar::yaz('Seslendirme Adres (URL)','Illustration Adress (URL)'),
			'anim_url' => Araclar::yaz('Animasyon Adres (URL)','Animation Adress (URL)'),
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('beceri_id',$this->beceri_id);
		$criteria->compare('sira',$this->sira);
		$criteria->compare('basamak_metni',$this->basamak_metni,true);
		$criteria->compare('video_url',$this->video_url,true);
		$criteria->compare('ses_url',$this->ses_url,true);
		$criteria->compare('anim_url',$this->anim_url,true);
		$criteria->compare('resim_url',$this->resim_url,true);
		$criteria->compare('kategori_mi',$this->kategori_mi);

		return new CActiveDataProvider(get_class($this), array(
			'criteria'=>$criteria,
		));
	}
}